package com.test.nnooolwdeaer.util_wooden.helper_wooden;

import android.provider.Settings;
import android.text.TextUtils;

import com.test.nnooolwdeaer.activity_fragment_wooden.base_wooden.BaseApplication_wooden;
import com.test.nnooolwdeaer.constant_wooden.Constant_wooden;

import org.jetbrains.annotations.NotNull;

public class DeviceHelper_wooden {

    private static class InnerDeviceHelper_wooden {
        private static final DeviceHelper_wooden instance_wooden = new DeviceHelper_wooden();
    }

    public static DeviceHelper_wooden getInstance_wooden() {
        return InnerDeviceHelper_wooden.instance_wooden;
    }

    @NotNull
    public static String getPackageName_wooden() {
        String pckName = BaseApplication_wooden.getApplication().getPackageName();
        if (TextUtils.isEmpty(pckName)) {
            pckName = BaseApplication_wooden.getApplication().getPackageName();
        }
        return pckName;
    }

    @NotNull
    public String getAndroidID_wooden() {
        String androidID = Settings.System.getString(BaseApplication_wooden.getApplication().getContentResolver(), Settings.Secure.ANDROID_ID);
        if (TextUtils.isEmpty(androidID)) {
            return System.currentTimeMillis() + "";
        }
        if (androidID.contains("00000000")) {
            return System.currentTimeMillis() + "";
        }
        return androidID;
    }

}
